package com.linwen.excise.leetcode;

/**
 * @ClassName _258各位相加
 * @Description TODO
 * @Author zero
 * @DATE 2024/9/22 2:03 AM
 * @Version 1.0
 */
public class _258各位相加 {
    public static void main(String[] args) {
        _258各位相加 inst = new _258各位相加();
        System.out.println(inst.addDigits(38));
    }
    public int addDigits(int num) {
        while (num>=10){
            num = num/10 + num%10;
        }
        return num;
    }
}
